<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>AngularJS基于模块化的MVC</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>
	<body>
		<div ng-app="myapp" ng-controller="myctrl">
			<div><input type="text" ng-model="name"/></div>
			<div>hello,{{name}}</div>
			<div ng-bind="name"></div>
		</div>
		
		<script type="text/javascript">
			//初始化myapp模块
			var myapp = angular.module("myapp",[]);
			//定义模块的控制器
			//依赖注入，$scope作用域对象，操作当前作用域视图
			myapp.controller("myctrl",["$scope",function($scope){
				//对模型进行初始化复制
				$scope.name="初音未来";
			}]);
		</script>
		
	</body>
</html>
